$(document).ready(function() {
    $("#submit").click(function() {
        var blacklistname = $("#blacklistname").val();
        if (blacklistname == '') 
        {
            alert("姓名不能为空！");
        }
        else
        {
            $.ajax({
                url: '../php/interface.php?method=addBlacklist',
                method: 'post',
                dataType: 'json',
                data: {
                    name: blacklistname
                }
            }).done(function(data) {
                if (data.result === true) {
                    if (data.result === true) {
                        location.href = 'blacklist.php';
                    }
                } else {
					if(data.msg === 'not login'){
						location.href = '../managerlogin.php';
					}else{
						alert(data.msg);
					}
                }
            });
        }
    });
});
